<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jquery-3.6.0.js"></script>
</head>
<body>
    <script>
        function getAjax(path,data){
            return new Promise((resolve,reject)=>{
                $.ajax({
                    type:'get',
                    url:path,
                    data:{data},
                    success:function(res){
                        resolve(res)
                    },
                    error:function(res){
                        reject(res)
                    }
                })
            })
        }

        getAjax('./data1.json')
        .then((value)=>{
            let id = {value};
            return getAjax("./data2.json",id)
        })
        .then((value)=>{
            let {username} = value;
            return getAjax('./data3.json',username)
        })
        .then((value)=>{
            console.log(value);
        })
    </script>
</body>
</html>